<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$setting=$this->plugin_setting('basic');
$return['banner']=$setting['hdps'];
$return['setting']=$setting;
if($_RQ['op']=='main'){
	$params=array('uniacid'=>$_SESSION['uniacid']);
	$return['params']=array('type'=>0);
	$parentid=intval($_RQ['id'])?:intval($_RQ['parentid']);
	if($parentid){
		$return['params']['id']=$return['params']['groupid']=$parentid;
		$url=custom_url('jy_kaoshi/group/id='.$parentid,true);
		$params['id']=$parentid;
		$groupnum=pdo_count('jy_kaoshi_group',array('uniacid'=>$_SESSION['uniacid'],'status'=>'1','parentid'=>$parentid));
		if(!$groupnum){
			$return['params']['type']=1;
		}
	}
	$group=pdo_get('jy_kaoshi_group',$params);
	$return['group']=$group;
	$return['list']=array();
	$return['sharedata']=array(
		'title'=>$group['title'],
		'desc'=>$group['desc'],
		'link'=>$url,
		'imgUrl'=>tomedia($group['image']),
	);
	$return['action']='jy_kaoshi/group';
	set_html('title',$group['title']);
	exi($return);
}
